#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int h[N], w[N];
int n, k;
bool check(int x)
{
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		ans += (h[i] / x) * (w[i] / x);
	}
	return ans >= k ? 1 : 0;
}
int main()
{
	cin >> n >> k;
	for (int i = 1; i <= n; i++)cin >> h[i] >> w[i];
	int l = 0, r = 1e5 + 1;
	while (l + 1 < r) {
		int mid = l + r >> 1;
		if (check(mid))l = mid;
		else r = mid;
	}
	cout << l << endl;
	return 0;
}